<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    {% include "component/static_resource_css.html" %}
    <title>Echo - 个人主页</title>
</head>
<body>
<div class="nk-container">
    {% include 'component/header.html' %}

    <!--		 内容 -->
    <div class="main">
        <div class="container">
            <!-- 选项 -->
            <div class="position-relative">
                <ul class="nav nav-tabs">
                    <li class="nav-item">
                        <a class="nav-link nav0" href="/user/profile/{{ user.id }}">个人信息</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link nav1" href="/user/discuss/{{ user.id }}">我的帖子</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link nav2" href="/user/comment/{{ user.id }}">我的回复</a>
                    </li>
                </ul>
            </div>

            <!-- 我的帖子 -->
            <div class="mt-4">
                <h6><b class="square"></b> 帖子总数 {{ post_count }}</h6>
                <ul class="list-unstyled mt-4 pl-3 pr-3">
                    {% for post in post_all %}
                        <li class="media pb-3 pt-3 mb-3 border-bottom">
                            <a href="/user/profile/{{ post.user_id }}">
                                <img src="{{ post.header_url }}" class="mr-4 rounded-circle" alt="用户头像"
                                     style="width:50px;height:50px;">
                            </a>
                            <div class="media-body">
                                <h6 class="mt-0 mb-3">
                                    <a href="/post/{{ post.id }}">{{ post.title }}</a>
                                    {% if post.type == 1 %}
                                        <span class="badge badge-secondary bg-danger"
                                              style="font-weight: 500; color: #f85959; background-color: rgba(248,89,89,0.1) !important;">顶</span>
                                    {% endif %}
                                    {% if post.status == 1 %}
                                        <span class="badge badge-secondary bg-primary"
                                              style="font-weight: 500; color: #3c8cff; background-color: rgba(60,140,255,0.1) !important;">精</span>
                                    {% endif %}
                                </h6>
                                <div class="text-muted font-size-12">
                                    <u class="mr-3">
                                        <a href="/user/profile/{{ post.user_id }}">
                                            {{ post.username }}
                                        </a>
                                    </u>
                                    <span class="mr-3">发布于</span><b>{{ post.create_time }}</b>
                                    <ul class="d-inline float-right">
                                        <li class="d-inline ml-2">
                                            <img class="like" src="/static/img/like01.svg"
                                                 style="width:20px;height:20px;cursor: pointer;"
                                                 id="like_{{ post.id }}"
                                            >
                                            <span>{{ post.like_count }}</span>
                                        </li>
                                        <li class="d-inline ml-2">|</li>
                                        <li class="d-inline ml-2">
                                            <img src="/static/img/comment.svg" style="width:20px;height:20px;">
                                            <span>{{ post.comment_count }}</span>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </li>
                    {% endfor %}
                </ul>
                <!-- 分页 -->
                {% include "component/pagination.html" %}
            </div>

        </div>
    </div>
    {% include "component/footer.html" %}
</div>
{% include "component/static_resource_js.html" %}
<script>
    $(document).ready(function () {
            console.log(11)
            var np = ".nav" + "{{profile_type}}"
            console.log(np)
            $(np).addClass('active')

        }
    );
</script>
</body>
</html>
